package flyway.based.databasemigration

import grails.boot.GrailsApp
import grails.boot.config.GrailsAutoConfiguration
import org.flywaydb.core.Flyway

class Application extends GrailsAutoConfiguration {
    static void main(String[] args) {
        // Create the Flyway instance and point it to the database
        def flyway = Flyway.configure().dataSource("jdbc:h2:tcp://localhost:9092/mem:flywaydb;MVCC=TRUE;LOCK_TIMEOUT=10000;", "sa", null).load()
        // Start the migration
        println "Flyway migrate:" + flyway.migrate()
        //run app
        GrailsApp.run(Application, args)
    }
}